<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="shortcut icon" href="images/print.gif" />
<style type="text/css">
body{width:650px; margin:30px auto 20px; text-align:center;}
</style>
</head>
<body>
<?php
include "config/koneksi.php";
include "config/identitas-situs.php";
include "config/tanggalan.php";
$file=$_GET[file];


if($file=="brosur"){
?>
<title>Cetak Brosur <?php echo $namasitus; ?> Terbaru</title>
<style type="text/css">
table{border-width:1px 0 0 1px; border-style:solid; border-color:#000; border-spacing:0}
th{border-width:0 1px 1px 0; border-style:solid; border-color:#000; background:#EBEBEB; padding:3px; text-align:center;}
td{border-bottom:1px solid #000; border-right:1px solid #000; background:#FFF; padding:3px; text-align:center;}
</style>
<center>
<?php echo "<b>$namasitus</b><br>$alamat<br>Telp/HP: $telp / $hp<br>Email: $email"; ?>
</center><br />
<table id="belang">
 <tr>
			<th>No.Pendaftaran</th>
			<th>Nama Lengkap</th>
			<th>Asal Sekolah</th>
			<th>Matematika</th>
			<th>Bhs.Indonesia</th>
			<th>Bhs.Inggris</th>
			<th>IPA</th>
			<th>Jumlah</th>
			<th>Rata-rata</th>
			<th>Status</th>
					
		</tr>
 	<?php
	$n=1;
 	$q=mysql_query("SELECT * FROM tb_proli ORDER BY kd_proli");
	while($r=mysql_fetch_array($q)){
	
	?>
 <tr>
 	<td align="center"><?php echo $n++; ?>
	<td align="left"><?php echo "$r[no_pendaftaran]"; ?></td>
 	<td align="left"><?php echo "$r[proli]"; ?></td>
    <td align="right"><?php echo "$r[nama] %"; ?></td>
    <td align="right"><?php echo "$r[asal_sekolah]"; ?></td>
    <td align="right"><?php echo "$r[matematika]"; ?></td>
	<td align="right"><?php echo "$r[indonesia]"; ?></td>
	<td align="right"><?php echo "$r[inggris]"; ?></td>
	<td align="right"><?php echo "$r[ipa]"; ?></td>
	<td align="right"><?php echo "$r[jumlah]"; ?></td>
	<td align="right"><?php echo "$r[rata2]"; ?></td>
	<td align="right"><?php echo "$r[status]"; ?></td>
 </tr>
    <?php } ?>
</table><br />
<form><img onclick="window.print()" src="images/print.gif" width="16" height="16" title="Klik Untuk Mencetak ke Printer" style="cursor:pointer" /></form>

<?php 
}

//CETAK FORMULIR PENDAFTARAN
elseif($file=="form-daftar"){
?>
<title>Cetak Formulir Pendaftaran <?php echo $namasitus; ?></title>
<img align="left" src="admin/images/Lambang_Kabupaten_Kebumen.jpg" border="0" width="80" height="80"/>
<style type="text/css">
table{border-width:0px 0px 0 0px; border-style:solid; border-color:#000; border-spacing:0}
td{border-width:0 0 0px 0; border-style:solid; border-color:#000; background:#FFF; padding:3px; text-align:left;}
</style>
<center>
<?php echo "<b>$namasitus</b><br>$alamat<br>Telp/HP: $telp / $hp<br>Email: $email"; ?>
<hr noshade="noshade" color="transparent" style="border-bottom:2px dotted #333" />
<b>BUKTI FORMULIR PENDAFTARAN<br />
            SMK NEGERI 1 KEBUMEN</b></center>
<?php
$ado = mysql_query("SELECT * FROM peserta WHERE id_peserta = '$_GET[id]' ");
$c = mysql_fetch_array($ado);
$agama=mysql_fetch_array(mysql_query("SELECT * FROM agama WHERE id_agama= '$c[id_agama]'"));
	if($c[jk]=="1"){
	$jk ="Laki-Laki";
	}else{
	$jk="Perempuan";}
?>
<table align="left" width="700">
 <tr>
   <td width="120">Pendaftar ke</td> 
   <td width="10"><div align="left">:</div></td> 
   <td width="69%"><?php echo $c[id_peserta]; ?></td>
 </tr>
 <tr>
   <td>Nama</td> 
   <td><div align="left">:</div></td> 
   <td><?php echo $c[nama]; ?></td>
 </tr>
 <tr>
   <td>Jenis Kelamin</td> <td><div align="left">:</div></td> 
   <td><?php echo $jk; ?></td>
 </tr>
 <tr>
   <td>Tempat, Tgl Lahir</td> <td><div align="left">:</div></td> 
   <td><?php echo "$c[tmpt_lahir], ".tanggalan($c[tgl_lahir]); ?></td>
 </tr>
 <tr>
   <td>Agama</td> <td><div align="left">:</div></td> 
   <td><?php echo $agama[agama]; ?></td>
 </tr>
 
 <tr>
   <td valign="top">Alamat</td> <td valign="top"><div align="left">:</div></td> 
   <td><?php echo $c[alamat]; ?></td>
 </tr>
 <tr>
   <td>Asal sekolah</td> <td><div align="left">:</div></td> 
   <td><?php echo $c[asal_sekolah]; ?></td>
 </tr>
 <tr>
   <td>Telpon siswa</td> <td><div align="left">:</div></td> 
   <td><?php echo $c[no_hp]; ?></td>
 </tr>
 <tr>
   <td>Nama Orangtua</td> <td><div align="left">:</div></td> 
   <td><?php echo $c[nama_ortu]; ?></td>
 </tr>
 <tr>
   <td>pekerjaan Orang tua</td> <td><div align="left">:</div></td> 
   <td><?php echo $c[pekerjaan_ortu]; ?></td>
 </tr>
 <tr>
   <td>Pilih Kelas  dan Waktu(*)</td> <td><div align="left">:</div></td> 
   <td><?php
	$vproli=mysql_fetch_array(mysql_query("select proli from tb_proli where kd_proli='$c[proli]'"));
	
	echo $vproli[proli]." ",$vwaktu[nama_waktu];
	?></td>
 </tr>
 <tr>
		<td align="left">Pilih Hari</td>
		<?php
			$phari=array();
			$phari=json_decode($c[pilih_hari]);
			for($z=0; $z<count($phari); $z++)
			{
				if($phari[$z]=="senin") 
				{
					$outhari.="Senin, ";
				}
				if($phari[$z]=="selasa")
				{
					$outhari.="Selasa, ";
				}
				if($phari[$z]=="rabu") 
				{
					$outhari.="Rabu, ";
				}
				if($phari[$z]=="kamis") 
				{
					$outhari.="Kamis, ";
				}
				if($phari[$z]=="jumat") 
				{
					$outhari.="Jumat, ";
				}
				if($phari[$z]=="sabtu")
				{
					$outhari.="Sabtu, ";
				}
			}
		?>
		<td><div align="left">:</div></td>
		<td><?php echo trim($outhari, ", ");?></td>
	</tr>
 
<tr><?php $tgl_posting=tanggalan($c[tanggal]); ?>
   <td colspan="3" style="text-align:right;"><br><br>Kebumen, <?php echo "$tgl_posting";?><br><br></td>
   </tr>
<tr> 
     <td colspan="3" style="text-align:left;">Menyetujui Orang Tua/ Wali&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Nama Peserta&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Petugas pendaftaran<br><br><br><br><br><br></td> 
  </tr>
  <tr>
  <td colspan="3" style="text-align:left;"> &nbsp;&nbsp;&nbsp;_______________&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_______________&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_______________
</td></tr>
<tr>
<td colspan="3" style="text-align:left; font-size:small">&nbsp;&nbsp;&nbsp;Nama & Tanda Tangan&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Nama & Tanda Tangan&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Nama & Tanda Tangan
</td></tr>
</table>
<div style="clear:both;"><br /><br />
 <form><img onclick="window.print()" src="images/print.gif" width="16" height="16" title="Klik Untuk Mencetak ke Printer" style="cursor:pointer" /></a>
</form>
</div>
<?php
}

//HALAMAN CETAK TANPA FILE
else { echo "<title>Cetak | $namasitus</title><center><b style='color:RED'>TIDAK ADA FILE TERPILIH</b></center>"; }
?>
</body>
</html>
